package com.example.business_oa.service;

import com.example.comment_oa.dubbo.ChaGangWeiJinTieDubbo;
import com.example.comment_oa.dubbo.SysEmployeeServiceDubbo;
import com.example.comment_oa.pojos.JobMakeoffer;
import com.example.comment_oa.pojos.MouthAt;
import com.example.comment_oa.pojos.SysEmployee;
import com.example.comment_oa.pojos.xinzi.JibenButiejisuan;
import com.example.comment_oa.pojos.xinzi.JibenKaoqinhesuan;
import com.example.comment_oa.pojos.xinzi.JibenXinzijisuan;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChaGangWeiJinService {

    @DubboReference(version = "1.0.0")
    ChaGangWeiJinTieDubbo chaGangWeiJinTieDubbo;

    @DubboReference(version = "1.0.0")
    SysEmployeeServiceDubbo sysEmployeeServiceDubbo;



    @GlobalTransactional(timeoutMills = 300000)
    public List<JobMakeoffer> selectGangweijintie(int BumenId,int ZhiwuId){


        List<JobMakeoffer> jobMakeoffers = chaGangWeiJinTieDubbo.selectGangWeiJinTie(BumenId, ZhiwuId);
        return jobMakeoffers;
    }

    @GlobalTransactional(timeoutMills = 300000)
    public SysEmployee selectJibenxinzi(String empCard){
        SysEmployee sysEmployee = sysEmployeeServiceDubbo.empCardID(empCard);
        return sysEmployee;
    }

    @GlobalTransactional(timeoutMills = 300000)
    public int insertall(JibenXinzijisuan jibenXinzijisuan){
        return chaGangWeiJinTieDubbo.insertAll(jibenXinzijisuan);
    }

    @GlobalTransactional(timeoutMills = 300000)
    public int insertKaoQinHeSuan(JibenKaoqinhesuan jibenKaoqinhesuan){
        return chaGangWeiJinTieDubbo.insertAllKaoQin(jibenKaoqinhesuan);
    }

    @GlobalTransactional(timeoutMills = 300000)
    public int insertButTieJisuan(JibenButiejisuan jibenButiejisuan){
        return chaGangWeiJinTieDubbo.insertAllBuTie(jibenButiejisuan);
    }



}
